package practite.Demo;

import java.util.Arrays;

public class Demo7 {
    public static void main(String[] args) {
        int[][] array = {{1, 25, 3, 46}, {5, 623, 7, 48}, {9512, 150, 1161, 112}};
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length - 1; j++) {
                for (int k = j + 1; k < array[i].length; k++) {
                    int r = i;
                    if (k + 1 == array[r].length - 1&&r<2) {
                        r++;
                        }
                    if (array[i][j] < array[r][k]) {
                                int a = array[i][j];
                                array[i][j] = array[r][k];
                                array[r][k] = a;

                        }
                    }
                }
            }



        int i = 0;
        while (i < array.length) {
            int j = 0;
            while (j < array[i].length) {
                System.out.println(array[i][j]);
                j++;
            }
            i++;

        }
    }

}